package com.itheima.test;

import java.util.Random;

public class test6 {
    public static void main(String[] args) {
        //需求:还是生成一个随机数
        //范围:1~100
        Random r = new Random();
        int number = r.nextInt(100)+1;
        //0~99
        System.out.println(number);

        //秘诀
        //用来生成任意数到任意数之间的随机数 7-15
        //1.让这个范围头尾都减去一个值,让这个范围从零开始
        /*Random r = new Random();
        int number = r.nextInt(9)+7;
        System.out.println(number);*/

    }
}
